home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1997 August / Walnut Creek CDROM.7z / VOL_400 / 446_01 / DOC / FDMSTART / EX5 / CONSLAW.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-04-18  |  951 b   |  30 lines

  1. #ifndef ConsLaw_h_IS_INCLUDED
  2. #define ConsLaw_h_IS_INCLUDED
  3. #include <FieldFD.h>
  4. #include <TimePrm.h>
  5. #include <FieldFunc.h>
  6.  
  7. // initial condition (function body in ConsLaw.C):
  8. extern real start1 (const Ptv(real)& x, real t = DUMMY);
  9. // flux function (function body in ConsLaw.C):
  10. extern real linearFlux (real u);
  11. typedef real (*Flux)(real u);  // flux function pointer
  12.  
  13. class ConsLaw
  14. {
  15.   Handle(GridLattice) grid;       // lattice grid (here: 1D grid)
  16.   Handle(FieldFD) u;              // solution at time step n+1
  17.   Handle(FieldFD) u_prev;         // solution at time step n
  18.   TimePrm tip;                    // time integration parameters (delta t etc.)
  19.   SetOfNo(real) time_points_for_plot; // time points for making plots
  20.   Flux f;                         // flux function, Flux is a function ptr
  21.   CurvPlotFile file;              // for plotting results
  22.  
  23. public:
  24.   ConsLaw () {}
  25.  ~ConsLaw () {}
  26.   void init ();
  27.   void solveProblem ();
  28. };
  29. #endif
  30.